﻿
namespace System.Windows.Forms
{
	internal static class ButtonExtension
	{
		public static void SetCueBanner(this TextBox textBox, string cueBannerText, bool retainOnFocus = false)
		{
			if (System.Environment.OSVersion.Version.Major >= 6)
			{
				const uint EM_SETCUEBANNER = 0x1501;
				Microsoft.Win32.NativeMethods.SendMessage(textBox.Handle, EM_SETCUEBANNER, new IntPtr(retainOnFocus ? 1 : 0), cueBannerText);
				textBox.Invalidate();
			}
			else
				throw new PlatformNotSupportedException();
		}
	}
}